/*
	Virtual Memory
*/
#ifndef VM_H
#define VM_H
#define VM_SUPER 0x4
#define VM_RW	0x2
#define VM_PRESENT 0x1
#define VM_KERNEL (VM_SUPER|VM_RW|VM_PRESENT)
#define VM_USER (VM_RW|VM_PRESENT)
uint32_t vm_alloc(uint32_t *kvmd, uint32_t *vmd, uint32_t flags);
uint32_t vm_alloc2(uint32_t *kvmd, uint32_t *vmd, uint32_t count, uint32_t flags);
uint32_t vm_find(uint32_t *kvmd, uint32_t *vmd, uint32_t start, uint32_t end, uint32_t count);
void vm_map2(uint32_t *kvmd, uint32_t *vmd, uint32_t p, uint32_t v, uint32_t flags, uint32_t count);
void vm_map(uint32_t *kvmd, uint32_t *vmd, uint32_t p, uint32_t v, uint32_t flags);
uint32_t* vm_make(uint32_t *kvmd);
uint32_t vm_talloc(uint32_t *kvmd, uint32_t *vmd, uint32_t index, uint32_t flags);
int vm_init();
int32_t vm_copy2(uint32_t *kvmd, uint32_t *fvmd, uint32_t *dvmd, uint32_t fv, uint32_t tv, uint32_t c, uint32_t flags);
void vm_free2(uint32_t *kvmd, uint32_t *vmd, uint32_t v, uint32_t c);
void vm_free(uint32_t *kvmd, uint32_t *vmd, uint32_t v);
#endif

